from django.contrib import admin
from django.contrib.auth.models import User
from taskize.django_gtd.models import *

class TagAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'owner',
                    'name',
                    )
                    
    list_filter = ('name',
                   )
                   
    save_on_top = True

class ItemAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'name',
                    'owner',
                    'effort',
                    'owner',
                    'priority',
                    'flag',
                    'notes',
                    'recurring',
                    'due',
                    'start',
                    'complete',
                    'source',
                    )

    list_filter = ('name',
                   )

    save_on_top = True

class PropertyAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'name',
                    )

    list_filter = ('name',
                   )

    save_on_top = True

class RecurringAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'days',
                    )

    list_filter = ('days',
                   )

    save_on_top = True

class FilterAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'owner',
                    'name',
                    'completed',
                    'flagged',
                    )

    list_filter = ('name',
                   )

    save_on_top = True

class SavedViewAdmin(admin.ModelAdmin):
    list_display = ('__str__', 
                    'name',
                    'owner',
                    )

    list_filter = ('name',
                   )

    save_on_top = True

# Register the models that we want to work with the admin site
admin.site.register(Tag, TagAdmin)
admin.site.register(Item, ItemAdmin)
admin.site.register(Property, PropertyAdmin)
admin.site.register(Recurring, RecurringAdmin)
admin.site.register(Filter, SavedViewAdmin)
admin.site.register(SavedView, SavedViewAdmin)
